package top.jojoace.JPA.model_DDL.BothWay_ManyToMany;

import lombok.Data;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import java.util.List;

@Entity
@Data
public class BW_Teacher {
    @Id
    private int id;
    private String name;
    private String course;

    /**
     * @ManyToMany 指定关系被维护端，
     * @ManyToMany(mappedBy = "连接该类的 类中的字段名")
     */
    @ManyToMany(mappedBy = "TeacherList")
    private List<BW_Student> StudentList;
}
